package com.wc.alorithm_blue_bridge._动态规划.施工;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

/**
 * @Author congge
 * @Date 2024/6/18 14:25
 * @description https://www.lanqiao.cn/problems/3465/learning/?page=1&first_category_id=1
 */

public class Main {
    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    static int N = 510, INF = 0x3f3f3f3f;
    static int[] h = new int[N];
    static int[][] f = new int[N][N];
    static int ll;
    static int[] idx = new int[N];
    static int n, x, y;

    public static void main(String[] args) {
        int T = sc.nextInt();
        while (T-- > 0) {
            n = sc.nextInt();
            x = sc.nextInt();
            y = sc.nextInt();
            for (int i = 1; i <= n; i++) h[i] = sc.nextInt();
            for (int i = 1; i <= n; i++) {
                Arrays.fill(f[i], 1, n + 1, INF);
                f[i][i] = x;
            }
            for (int len = 2; len <= n; len++) {
                for (int l = 1; l + len - 1 <= n; l++) {
                    int r = l + len - 1;
                    // 是否满足这个区间直接被y处理了
//                    boolean isContain = true;
//                    for (int i = l + 1; i <= r - 1; i++) {
//                        if (h[i] >= h[l]) {
//                            isContain = false;
//                            break;
//                        }
//                    }
//                    if (isContain && h[r] >= h[l]) f[l][r] = Math.min(f[l][r], y);
                    if (h[r] >= h[l]) {
                        ll = 0;
                        for (int i = l + 1; i < r; i++) {
                            if (h[i] >= h[l]) idx[++ll] = i;
                        }
                        if (ll == 1) f[l][r] = Math.min(f[l][r], x + y);
                        else f[l][r] = Math.min(f[l][r], f[idx[1]][idx[ll]] + y);
                    }
                    for (int md = l; md < r; md++) {
                        f[l][r] = Math.min(f[l][r], f[l][md] + f[md + 1][r]);
                    }
                }
            }

            out.println(f[1][n]);
        }
        out.flush();
    }
}

class FastReader {
    StringTokenizer st;
    BufferedReader br;

    FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    String nextLine() {
        String s = "";
        try {
            s = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return s;
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    // 是否由下一个
    boolean hasNext() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                String line = br.readLine();
                if (line == null)
                    return false;
                st = new StringTokenizer(line);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return true;
    }
}
